package com.hyb.service.impl;

import com.hyb.entity.Role;
import com.hyb.mapper.RoleMapper;
import com.hyb.service.RoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Set;

/**
 * <p>
 *  角色Service接口实现类
 * </p>
 *
 * @author hyb
 * @since 2021-12-29
 */
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements RoleService {

    @Autowired
    private RoleMapper roleMapper;

    @Override
    public Set<String> getRolesByStaffEmail(String staffEmail) {
        return roleMapper.selectRolesByStaffEmail(staffEmail);
    }

    @Override
    public List<Role> getAllRoles() {
        return roleMapper.selectList(null);
    }
}
